import request from "@/uitls/request";
import { TradeMarkResponseData, ResponseData, TradeMark } from "./type";
enum URL_API {
  LIST_URL = "/admin/product/baseTrademark/",
  DELETE_URL = "/admin/product/baseTrademark/remove/",
  UPLODA_URL = "/admin/product/fileUpload",
  ADDPRODUCT_URL = "/admin/product/baseTrademark/save",
  CHANGPRODUCT_URL = "/admin/product/baseTrademark/update",
}
export const getProductlist = (page: number, limit: number) =>
  request.get<any, TradeMarkResponseData>(
    URL_API.LIST_URL + `${page}/${limit}`
  );
export const delProductOnes = (id: number) =>
  request.delete<any, ResponseData>(URL_API.DELETE_URL + `${id}`);
export const uplodaImg = (file: File) =>
  request.post<any, any>(URL_API.UPLODA_URL, file);
// 新增
export const addProduct = (data: TradeMark) =>
  request.post<any, ResponseData>(URL_API.ADDPRODUCT_URL, data);
// 修改
export const changProduct = (data: TradeMark) =>
  request.put<any, ResponseData>(URL_API.ADDPRODUCT_URL, data);
